package cn.newgrand.netcall.integration;

import org.jivesoftware.spark.SparkManager;
import org.jivesoftware.spark.preference.Preference;

import cn.newgrand.netcall.integration.interaction.WinInteraction;
import cn.newgrand.netcall.integration.menu.AppSysMenuHandler;
import cn.newgrand.netcall.integration.setting.SettingPreference;
import cn.newgrand.netcall.integration.sms.SMSManager;

/**
 * @author SidneyRen E-mail:SidneyRen@hotmail.com
 * @version create time：2010-11-4 下午04:00:55
 * 类说明
 */
public class IntegrationManager {
	private static WinInteraction winInter;
	private static AppSysMenuHandler appSysMenuHandler;
	private static SMSManager smsHandler;
	private static SettingPreference settingPreference;
	
	public static WinInteraction getWinInteraction(){
		if(null!=winInter){
			return winInter;
		}else{
			winInter = new WinInteraction();
			return winInter;
		}
	}
	
	public static AppSysMenuHandler getAppSysMenuHandler(){
		if(null!=appSysMenuHandler){
			return appSysMenuHandler;
		}else{
			appSysMenuHandler = new AppSysMenuHandler();
			return appSysMenuHandler;
		}
	}
	
	public static SMSManager getSMSManager(){
		return SMSManager.getInstance();
	}
	
	public static void initPreference(){
		settingPreference = new SettingPreference();
        SparkManager.getPreferenceManager().addPreference(settingPreference);
	}
	
	public static SettingPreference getSettingPreference(){
		if( settingPreference==null){
			return settingPreference =  new SettingPreference();
		}else{
			return settingPreference;
		}
	}
	
	
}
